<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="offer_board.db.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
//System.out.println(request.getAttribute("listcount")+" "+request.getAttribute("page")+" "+request.getAttribute("maxpage")+" " +request.getAttribute("startpage")+" "+request.getAttribute("endpage"));

	List boardListCasual=null;
	int listcount=1;
	int nowpage=1;
	int maxpage=1;
	int startpage=1;
	int endpage=1;
	
	if(request.getAttribute("listcount")==null)
	{
		response.sendRedirect("./BoardListCasual.of");
	}
	else
	{
		System.out.println("list_casual.jsp 에 23라인 탄다");
		boardListCasual=(List)request.getAttribute("boardlistcasual");
		listcount=((Integer)request.getAttribute("listcount")).intValue();
		nowpage=((Integer)request.getAttribute("page")).intValue();
		maxpage=((Integer)request.getAttribute("maxpage")).intValue();
		startpage=((Integer)request.getAttribute("startpage")).intValue();
		endpage=((Integer)request.getAttribute("endpage")).intValue();
%>

<html>
<head>
<title>MVC 게시판</title>
</head>

<body>
<!-- 게시판 리스트 -->
<table width=50% border="0" cellpadding="0" cellspacing="0"
	align="center">
	<tr align="center" valign="middle">
		<td colspan="4">MVC 게시판</td>
		<td align=right><font size=2>글 개수 : ${listcount }</font></td>
	</tr>

	<tr align="center" valign="middle" bordercolor="#333333">
		<td style="font-family: Tahoma; font-size: 8pt;" width="8%"
			height="26">
		<div align="center">글번호</div>
		</td>
		<td style="font-family: Tahoma; font-size: 8pt;" width="50%">
		<div align="center">상품</div>
		</td>
		<td style="font-family: Tahoma; font-size: 8pt;" width="11%">
		<div align="center">제품번호</div>
		</td>
		<td style="font-family: Tahoma; font-size: 8pt;" width="10%">
		<div align="center">삭제</div>
		</td>
		<!-- 
		<td style="font-family:Tahoma;font-size:8pt;" width="14%">
			<div align="center">코디01</div>
		</td>
		<td style="font-family:Tahoma;font-size:8pt;" width="17%">
			<div align="center">태그</div>
		</td>
		-->
		

	</tr>

	<%
		for(int i=0;i<boardListCasual.size();i++){
			BoardBean bl=(BoardBean)boardListCasual.get(i);
	%>
	<tr align="center" valign="middle" bordercolor="#333333"
		onmouseover="this.style.backgroundColor='F8F8F8'"
		onmouseout="this.style.backgroundColor=''">
		<td height="23" style="font-family: Tahoma; font-size: 10pt;"><%=bl.getNum()%>
		</td>

		<td style="font-family: Tahoma; font-size: 10pt;">
		<div align="left"><a
			href="./BoardDetailAction.of?product_num=<%=bl.getProduct_num()%>">
		<img
			src="C:\shopdesign\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\dahongProject\boardupload\<%=bl.getBoard_file()%>"
			width="100" hight="200" border="0" /> </a></div>
		</td>
		<td style="font-family: Tahoma; font-size: 10pt;">
		<div align="center"><%=bl.getProduct_num() %></div>
		</td>
		<td>
		<div align="center"><a
			href="./BoardDelete.of?product_num=<%=bl.getProduct_num()%>">
		[삭제] </div>
		</td>
		<!-- 
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="center"><%=bl.getCody01() %></div>
		</td>
		<td style="font-family:Tahoma;font-size:10pt;">
			<div align="center"><%=bl.getTags() %></div>
		</td>
		-->
		

	</tr>
	<%} %>
	<tr align=center height=20>
		<td colspan=7 style="font-family: Tahoma; font-size: 10pt;">
		<%if(nowpage<=1){ %> [이전]&nbsp; <%}else{ %> <a
			href="./BoardList.of?page=<%=nowpage-1 %>">[이전]</a>&nbsp; <%} %> <%for(int a=startpage;a<=endpage;a++){
				if(a==nowpage){%> [<%=a %>] <%}else{ %> <a
			href="./BoardList.of?page=<%=a %>">[<%=a %>]</a>&nbsp; <%} %> <%} %> <%if(nowpage>=maxpage){ %>
		[다음] <%}else{ %> <a href="./BoardList.of?page=<%=nowpage+1 %>">[다음]</a>
		<%} %>
		</td>
	</tr>

</table>
<%} %>
</body>
</html>